{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4b42bb86-e1ac-4c66-9ed2-6c2bfdfd5b09",
   "metadata": {},
   "outputs": [],
   "source": [
    "import statsmodels.api as sm\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6cd58c48-69a1-4b3e-94d7-fa35766114bc",
   "metadata": {},
   "source": [
    "## 构建线性回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "685717e6-0ff4-4689-b241-64ec05cf18c3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市</th>\n",
       "      <th>价格</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>397300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1998.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>B</td>\n",
       "      <td>719500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>B</td>\n",
       "      <td>628300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>D</td>\n",
       "      <td>359300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1210.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "      <td>487500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1817.4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "      <td>680100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>2035.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>A</td>\n",
       "      <td>705000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1045.3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>B</td>\n",
       "      <td>454400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1735.1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>A</td>\n",
       "      <td>629300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>944.3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>B</td>\n",
       "      <td>389200</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         面积  卧室数  厕所数 所在城市      价格\n",
       "0     957.2    2    1    C  397300\n",
       "1    1998.7    3    1    B  719500\n",
       "2    1641.5    4    3    B  628300\n",
       "3     746.9    2    2    D  359300\n",
       "4    1210.7    3    1    D  487500\n",
       "..      ...  ...  ...  ...     ...\n",
       "995  1817.4    4    2    C  680100\n",
       "996  2035.0    2    2    A  705000\n",
       "997  1045.3    3    3    B  454400\n",
       "998  1735.1    2    3    A  629300\n",
       "999   944.3    3    1    B  389200\n",
       "\n",
       "[1000 rows x 5 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取示例数据\n",
    "data = pd.read_csv(\"house_price_simple.csv\")\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "779f7847-586b-4e03-896d-97a8f337ef0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>价格</th>\n",
       "      <th>所在城市_B</th>\n",
       "      <th>所在城市_C</th>\n",
       "      <th>所在城市_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>397300</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1998.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>719500</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>628300</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>359300</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1210.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>487500</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1817.4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>680100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>2035.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>705000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1045.3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>454400</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1735.1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>629300</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>944.3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>389200</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         面积  卧室数  厕所数      价格  所在城市_B  所在城市_C  所在城市_D\n",
       "0     957.2    2    1  397300       0       1       0\n",
       "1    1998.7    3    1  719500       1       0       0\n",
       "2    1641.5    4    3  628300       1       0       0\n",
       "3     746.9    2    2  359300       0       0       1\n",
       "4    1210.7    3    1  487500       0       0       1\n",
       "..      ...  ...  ...     ...     ...     ...     ...\n",
       "995  1817.4    4    2  680100       0       1       0\n",
       "996  2035.0    2    2  705000       0       0       0\n",
       "997  1045.3    3    3  454400       1       0       0\n",
       "998  1735.1    2    3  629300       0       0       0\n",
       "999   944.3    3    1  389200       1       0       0\n",
       "\n",
       "[1000 rows x 7 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 为data的“所在城市”分类变量创建虚拟变量，并指定虚拟变量类型为整数，且删除掉第一个虚拟变量\n",
    "data = pd.get_dummies(data, columns=['所在城市'], dtype=int, drop_first=True)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "6be037c7-c948-4ebb-b6a7-8bf2b6a49a5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建构建线性回归模型所需的因变量和自变量\n",
    "y = data['价格']\n",
    "X = data.drop('价格', axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "023f13b2-5209-4775-aa5b-04ef93dddc51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市_B</th>\n",
       "      <th>所在城市_C</th>\n",
       "      <th>所在城市_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>面积</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.047081</td>\n",
       "      <td>0.004138</td>\n",
       "      <td>0.008722</td>\n",
       "      <td>0.036042</td>\n",
       "      <td>0.029804</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>卧室数</th>\n",
       "      <td>0.047081</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.002197</td>\n",
       "      <td>0.009218</td>\n",
       "      <td>0.003517</td>\n",
       "      <td>0.026641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>厕所数</th>\n",
       "      <td>0.004138</td>\n",
       "      <td>0.002197</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.024887</td>\n",
       "      <td>0.020576</td>\n",
       "      <td>0.000202</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>所在城市_B</th>\n",
       "      <td>0.008722</td>\n",
       "      <td>0.009218</td>\n",
       "      <td>0.024887</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.348452</td>\n",
       "      <td>0.322664</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>所在城市_C</th>\n",
       "      <td>0.036042</td>\n",
       "      <td>0.003517</td>\n",
       "      <td>0.020576</td>\n",
       "      <td>0.348452</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.337299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>所在城市_D</th>\n",
       "      <td>0.029804</td>\n",
       "      <td>0.026641</td>\n",
       "      <td>0.000202</td>\n",
       "      <td>0.322664</td>\n",
       "      <td>0.337299</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              面积       卧室数       厕所数    所在城市_B    所在城市_C    所在城市_D\n",
       "面积      1.000000  0.047081  0.004138  0.008722  0.036042  0.029804\n",
       "卧室数     0.047081  1.000000  0.002197  0.009218  0.003517  0.026641\n",
       "厕所数     0.004138  0.002197  1.000000  0.024887  0.020576  0.000202\n",
       "所在城市_B  0.008722  0.009218  0.024887  1.000000  0.348452  0.322664\n",
       "所在城市_C  0.036042  0.003517  0.020576  0.348452  1.000000  0.337299\n",
       "所在城市_D  0.029804  0.026641  0.000202  0.322664  0.337299  1.000000"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看X里所有变量之间的相关系数，并求绝对值\n",
    "X.corr().abs()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a51a9efe-b9ad-43f5-bab9-9937ae04a29e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 这一步是为了下面绘图做准备，由于DataFrame的列名为中文，MatPlotlib的字体无法直接展示，需要替换字体\n",
    "import matplotlib\n",
    "# 把图表默认的字体替换成Heiti TC字体（你的系统上不一定有这个字体，如果没有的话需要替换成其它的）\n",
    "matplotlib.rc(\"font\",family='Heiti TC')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7726f76c-d202-4854-8df5-95c8c5850cd3",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 38754 (\\N{CJK UNIFIED IDEOGRAPH-9762}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 31215 (\\N{CJK UNIFIED IDEOGRAPH-79EF}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 21351 (\\N{CJK UNIFIED IDEOGRAPH-5367}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 23460 (\\N{CJK UNIFIED IDEOGRAPH-5BA4}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 21397 (\\N{CJK UNIFIED IDEOGRAPH-5395}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 25152 (\\N{CJK UNIFIED IDEOGRAPH-6240}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 22312 (\\N{CJK UNIFIED IDEOGRAPH-5728}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 22478 (\\N{CJK UNIFIED IDEOGRAPH-57CE}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\seaborn\\utils.py:80: UserWarning: Glyph 24066 (\\N{CJK UNIFIED IDEOGRAPH-5E02}) missing from current font.\n",
      "  fig.canvas.draw()\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 38754 (\\N{CJK UNIFIED IDEOGRAPH-9762}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 31215 (\\N{CJK UNIFIED IDEOGRAPH-79EF}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 21351 (\\N{CJK UNIFIED IDEOGRAPH-5367}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 23460 (\\N{CJK UNIFIED IDEOGRAPH-5BA4}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 21397 (\\N{CJK UNIFIED IDEOGRAPH-5395}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 25152 (\\N{CJK UNIFIED IDEOGRAPH-6240}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 22312 (\\N{CJK UNIFIED IDEOGRAPH-5728}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 22478 (\\N{CJK UNIFIED IDEOGRAPH-57CE}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\events.py:93: UserWarning: Glyph 24066 (\\N{CJK UNIFIED IDEOGRAPH-5E02}) missing from current font.\n",
      "  func(*args, **kwargs)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 38754 (\\N{CJK UNIFIED IDEOGRAPH-9762}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 31215 (\\N{CJK UNIFIED IDEOGRAPH-79EF}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 21351 (\\N{CJK UNIFIED IDEOGRAPH-5367}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 23460 (\\N{CJK UNIFIED IDEOGRAPH-5BA4}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 21397 (\\N{CJK UNIFIED IDEOGRAPH-5395}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 25152 (\\N{CJK UNIFIED IDEOGRAPH-6240}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 22312 (\\N{CJK UNIFIED IDEOGRAPH-5728}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 22478 (\\N{CJK UNIFIED IDEOGRAPH-57CE}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "C:\\Users\\ADMIN\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 24066 (\\N{CJK UNIFIED IDEOGRAPH-5E02}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n",
      "findfont: Font family 'Heiti TC' not found.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGiCAYAAAB6c8WBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA4V0lEQVR4nO3dfXzN9f/H8efZbGNEZTbXUfr+EoUwjEStVqL0RbpgLkoXkovVtywyJlbpglxE5aJclJKkRN8aWn2Ti40QKteFXSCGzTbb+f2xrM7Zmc6Hc/Y583ncu31u3bzP+3w+r8/7trO9zvvqY7Pb7XYBAADL8jM7AAAAYC6SAQAALI5kAAAAiyMZAADA4kgGAACwOJIBAAAsj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vXr1mDz3N/fee6/uvfdes8MwDT8Pvok5AwAAWJylegaqVKmizz//XJ9//nmx16KionTs2DG1aNHC5Xv9/Mpu3nSh9127dm09/fTTLl9/7rnnPBqrN12s7eDt+6pQoYK2bt3q8hzXXXedHnvsMc2bN8/l+3v16qXp06cbuJvzRzsUoh1wPmx2+msAXID09HRlZma6fK1y5coKDQ0t5YjMQTsUoh3KJpIBAAAsruz2fQMAAI8gGQAAwOJIBgAAsDiSAQAALI5kAAAAiyMZAADA4kgGAACwuP8HPr3LBf7ibbYAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 对X里所有变量之间的相关系数的绝对值绘制热力图\n",
    "sns.heatmap(X.corr().abs(), annot=True)\n",
    "plt.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "929bba35-ffb5-4e6f-bd91-27b4712f6692",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>const</th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市_B</th>\n",
       "      <th>所在城市_C</th>\n",
       "      <th>所在城市_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1998.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.0</td>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1210.7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1817.4</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2035.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1045.3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1735.1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>1.0</td>\n",
       "      <td>944.3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     const      面积  卧室数  厕所数  所在城市_B  所在城市_C  所在城市_D\n",
       "0      1.0   957.2    2    1       0       1       0\n",
       "1      1.0  1998.7    3    1       1       0       0\n",
       "2      1.0  1641.5    4    3       1       0       0\n",
       "3      1.0   746.9    2    2       0       0       1\n",
       "4      1.0  1210.7    3    1       0       0       1\n",
       "..     ...     ...  ...  ...     ...     ...     ...\n",
       "995    1.0  1817.4    4    2       0       1       0\n",
       "996    1.0  2035.0    2    2       0       0       0\n",
       "997    1.0  1045.3    3    3       1       0       0\n",
       "998    1.0  1735.1    2    3       0       0       0\n",
       "999    1.0   944.3    3    1       1       0       0\n",
       "\n",
       "[1000 rows x 7 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 在自变量里添加一个常量（为了引入截距）\n",
    "X = sm.add_constant(X)\n",
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a2bc09bf-864d-456f-bacc-cf74773d8076",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>OLS Regression Results</caption>\n",
       "<tr>\n",
       "  <th>Dep. Variable:</th>           <td>价格</td>        <th>  R-squared:         </th> <td>   0.998</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Model:</th>                   <td>OLS</td>       <th>  Adj. R-squared:    </th> <td>   0.998</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Method:</th>             <td>Least Squares</td>  <th>  F-statistic:       </th> <td>7.766e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Date:</th>             <td>Wed, 25 Oct 2023</td> <th>  Prob (F-statistic):</th>  <td>  0.00</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Time:</th>                 <td>20:19:29</td>     <th>  Log-Likelihood:    </th> <td> -10262.</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>No. Observations:</th>      <td>  1000</td>      <th>  AIC:               </th> <td>2.054e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Residuals:</th>          <td>   993</td>      <th>  BIC:               </th> <td>2.057e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Model:</th>              <td>     6</td>      <th>                     </th>     <td> </td>    \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Covariance Type:</th>      <td>nonrobust</td>    <th>                     </th>     <td> </td>    \n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "     <td></td>       <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>const</th>  <td> 6.824e+04</td> <td> 1383.024</td> <td>   49.341</td> <td> 0.000</td> <td> 6.55e+04</td> <td>  7.1e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>面积</th>     <td>  299.7279</td> <td>    0.440</td> <td>  680.850</td> <td> 0.000</td> <td>  298.864</td> <td>  300.592</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>卧室数</th>    <td> 8365.4726</td> <td>  270.523</td> <td>   30.923</td> <td> 0.000</td> <td> 7834.610</td> <td> 8896.335</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>厕所数</th>    <td> 1.131e+04</td> <td>  394.998</td> <td>   28.640</td> <td> 0.000</td> <td> 1.05e+04</td> <td> 1.21e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>所在城市_B</th> <td> 4250.1208</td> <td>  625.407</td> <td>    6.796</td> <td> 0.000</td> <td> 3022.850</td> <td> 5477.391</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>所在城市_C</th> <td> 9213.1877</td> <td>  615.594</td> <td>   14.966</td> <td> 0.000</td> <td> 8005.173</td> <td> 1.04e+04</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>所在城市_D</th> <td> 1.506e+04</td> <td>  633.226</td> <td>   23.779</td> <td> 0.000</td> <td> 1.38e+04</td> <td> 1.63e+04</td>\n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "  <th>Omnibus:</th>       <td> 4.096</td> <th>  Durbin-Watson:     </th> <td>   2.050</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Prob(Omnibus):</th> <td> 0.129</td> <th>  Jarque-Bera (JB):  </th> <td>   3.538</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Skew:</th>          <td>-0.066</td> <th>  Prob(JB):          </th> <td>   0.170</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Kurtosis:</th>      <td> 2.740</td> <th>  Cond. No.          </th> <td>1.02e+04</td>\n",
       "</tr>\n",
       "</table><br/><br/>Notes:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.<br/>[2] The condition number is large, 1.02e+04. This might indicate that there are<br/>strong multicollinearity or other numerical problems."
      ],
      "text/latex": [
       "\\begin{center}\n",
       "\\begin{tabular}{lclc}\n",
       "\\toprule\n",
       "\\textbf{Dep. Variable:}    &        价格        & \\textbf{  R-squared:         } &     0.998   \\\\\n",
       "\\textbf{Model:}            &       OLS        & \\textbf{  Adj. R-squared:    } &     0.998   \\\\\n",
       "\\textbf{Method:}           &  Least Squares   & \\textbf{  F-statistic:       } & 7.766e+04   \\\\\n",
       "\\textbf{Date:}             & Wed, 25 Oct 2023 & \\textbf{  Prob (F-statistic):} &     0.00    \\\\\n",
       "\\textbf{Time:}             &     20:19:29     & \\textbf{  Log-Likelihood:    } &   -10262.   \\\\\n",
       "\\textbf{No. Observations:} &        1000      & \\textbf{  AIC:               } & 2.054e+04   \\\\\n",
       "\\textbf{Df Residuals:}     &         993      & \\textbf{  BIC:               } & 2.057e+04   \\\\\n",
       "\\textbf{Df Model:}         &           6      & \\textbf{                     } &             \\\\\n",
       "\\textbf{Covariance Type:}  &    nonrobust     & \\textbf{                     } &             \\\\\n",
       "\\bottomrule\n",
       "\\end{tabular}\n",
       "\\begin{tabular}{lcccccc}\n",
       "                 & \\textbf{coef} & \\textbf{std err} & \\textbf{t} & \\textbf{P$> |$t$|$} & \\textbf{[0.025} & \\textbf{0.975]}  \\\\\n",
       "\\midrule\n",
       "\\textbf{const}   &    6.824e+04  &     1383.024     &    49.341  &         0.000        &     6.55e+04    &      7.1e+04     \\\\\n",
       "\\textbf{面积}      &     299.7279  &        0.440     &   680.850  &         0.000        &      298.864    &      300.592     \\\\\n",
       "\\textbf{卧室数}     &    8365.4726  &      270.523     &    30.923  &         0.000        &     7834.610    &     8896.335     \\\\\n",
       "\\textbf{厕所数}     &    1.131e+04  &      394.998     &    28.640  &         0.000        &     1.05e+04    &     1.21e+04     \\\\\n",
       "\\textbf{所在城市\\_B} &    4250.1208  &      625.407     &     6.796  &         0.000        &     3022.850    &     5477.391     \\\\\n",
       "\\textbf{所在城市\\_C} &    9213.1877  &      615.594     &    14.966  &         0.000        &     8005.173    &     1.04e+04     \\\\\n",
       "\\textbf{所在城市\\_D} &    1.506e+04  &      633.226     &    23.779  &         0.000        &     1.38e+04    &     1.63e+04     \\\\\n",
       "\\bottomrule\n",
       "\\end{tabular}\n",
       "\\begin{tabular}{lclc}\n",
       "\\textbf{Omnibus:}       &  4.096 & \\textbf{  Durbin-Watson:     } &    2.050  \\\\\n",
       "\\textbf{Prob(Omnibus):} &  0.129 & \\textbf{  Jarque-Bera (JB):  } &    3.538  \\\\\n",
       "\\textbf{Skew:}          & -0.066 & \\textbf{  Prob(JB):          } &    0.170  \\\\\n",
       "\\textbf{Kurtosis:}      &  2.740 & \\textbf{  Cond. No.          } & 1.02e+04  \\\\\n",
       "\\bottomrule\n",
       "\\end{tabular}\n",
       "%\\caption{OLS Regression Results}\n",
       "\\end{center}\n",
       "\n",
       "Notes: \\newline\n",
       " [1] Standard Errors assume that the covariance matrix of the errors is correctly specified. \\newline\n",
       " [2] The condition number is large, 1.02e+04. This might indicate that there are \\newline\n",
       " strong multicollinearity or other numerical problems."
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.summary.Summary'>\n",
       "\"\"\"\n",
       "                            OLS Regression Results                            \n",
       "==============================================================================\n",
       "Dep. Variable:                     价格   R-squared:                       0.998\n",
       "Model:                            OLS   Adj. R-squared:                  0.998\n",
       "Method:                 Least Squares   F-statistic:                 7.766e+04\n",
       "Date:                Wed, 25 Oct 2023   Prob (F-statistic):               0.00\n",
       "Time:                        20:19:29   Log-Likelihood:                -10262.\n",
       "No. Observations:                1000   AIC:                         2.054e+04\n",
       "Df Residuals:                     993   BIC:                         2.057e+04\n",
       "Df Model:                           6                                         \n",
       "Covariance Type:            nonrobust                                         \n",
       "==============================================================================\n",
       "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
       "------------------------------------------------------------------------------\n",
       "const       6.824e+04   1383.024     49.341      0.000    6.55e+04     7.1e+04\n",
       "面积           299.7279      0.440    680.850      0.000     298.864     300.592\n",
       "卧室数         8365.4726    270.523     30.923      0.000    7834.610    8896.335\n",
       "厕所数         1.131e+04    394.998     28.640      0.000    1.05e+04    1.21e+04\n",
       "所在城市_B      4250.1208    625.407      6.796      0.000    3022.850    5477.391\n",
       "所在城市_C      9213.1877    615.594     14.966      0.000    8005.173    1.04e+04\n",
       "所在城市_D      1.506e+04    633.226     23.779      0.000    1.38e+04    1.63e+04\n",
       "==============================================================================\n",
       "Omnibus:                        4.096   Durbin-Watson:                   2.050\n",
       "Prob(Omnibus):                  0.129   Jarque-Bera (JB):                3.538\n",
       "Skew:                          -0.066   Prob(JB):                        0.170\n",
       "Kurtosis:                       2.740   Cond. No.                     1.02e+04\n",
       "==============================================================================\n",
       "\n",
       "Notes:\n",
       "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
       "[2] The condition number is large, 1.02e+04. This might indicate that there are\n",
       "strong multicollinearity or other numerical problems.\n",
       "\"\"\""
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 构建线性回归模型，并进行数据拟合\n",
    "result = sm.OLS(y, X).fit()\n",
    "# 输出拟合结果\n",
    "result.summary()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2300ddab-c2e9-4985-9015-496a51f11f25",
   "metadata": {},
   "source": [
    "## 预测新数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a0a45844-3ddf-429c-b4ae-90e626426d05",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1998.7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1210.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2325.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>286.7</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1285.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2133.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1066.6</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       面积  卧室数  厕所数 所在城市\n",
       "0   957.2    2    2    C\n",
       "1  1998.7    2    2    C\n",
       "2  1641.5    4    1    C\n",
       "3   746.9    2    2    C\n",
       "4  1210.7    2    1    B\n",
       "5  2325.7    2    1    C\n",
       "6   286.7    4    2    A\n",
       "7  1285.5    4    1    D\n",
       "8  2133.0    3    1    D\n",
       "9  1066.6    3    1    D"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取用于预测的示例数据\n",
    "new_observation = pd.read_csv(\"house_price_predict_simple.csv\")\n",
    "new_observation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e10ca4d7-09b7-4857-93ab-f4fb8ed6e3a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1998.7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1210.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2325.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>286.7</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1285.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2133.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1066.6</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       面积  卧室数  厕所数 所在城市\n",
       "0   957.2    2    2    C\n",
       "1  1998.7    2    2    C\n",
       "2  1641.5    4    1    C\n",
       "3   746.9    2    2    C\n",
       "4  1210.7    2    1    B\n",
       "5  2325.7    2    1    C\n",
       "6   286.7    4    2    A\n",
       "7  1285.5    4    1    D\n",
       "8  2133.0    3    1    D\n",
       "9  1066.6    3    1    D"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 把new_observation的“所在城市”列转换为包含'A'、'B'、'C'、'D'类别的分类变量|\n",
    "new_observation['所在城市'] = pd.Categorical(new_observation['所在城市'], categories=['A', 'B', 'C', 'D'])\n",
    "new_observation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "bd487848-0d49-48e1-9e00-4d3f45ad22c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市_B</th>\n",
       "      <th>所在城市_C</th>\n",
       "      <th>所在城市_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1998.7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1210.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2325.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>286.7</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1285.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2133.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1066.6</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       面积  卧室数  厕所数  所在城市_B  所在城市_C  所在城市_D\n",
       "0   957.2    2    2     0.0     1.0     0.0\n",
       "1  1998.7    2    2     0.0     1.0     0.0\n",
       "2  1641.5    4    1     0.0     1.0     0.0\n",
       "3   746.9    2    2     0.0     1.0     0.0\n",
       "4  1210.7    2    1     1.0     0.0     0.0\n",
       "5  2325.7    2    1     0.0     1.0     0.0\n",
       "6   286.7    4    2     0.0     0.0     0.0\n",
       "7  1285.5    4    1     0.0     0.0     1.0\n",
       "8  2133.0    3    1     0.0     0.0     1.0\n",
       "9  1066.6    3    1     0.0     0.0     1.0"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 为new_observation的“所在城市”分类变量创建虚拟变量，并指定虚拟变量类型为整数，且删除掉第一个虚拟变量\n",
    "new_observation = pd.get_dummies(new_observation, columns=['所在城市'], dtype=float, drop_first=True)\n",
    "new_observation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "850ff164-ce48-4ce1-9de4-3000a0d6890e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>const</th>\n",
       "      <th>面积</th>\n",
       "      <th>卧室数</th>\n",
       "      <th>厕所数</th>\n",
       "      <th>所在城市_B</th>\n",
       "      <th>所在城市_C</th>\n",
       "      <th>所在城市_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>957.2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1998.7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1641.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.0</td>\n",
       "      <td>746.9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1210.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2325.7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1.0</td>\n",
       "      <td>286.7</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1285.5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2133.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1066.6</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   const      面积  卧室数  厕所数  所在城市_B  所在城市_C  所在城市_D\n",
       "0    1.0   957.2    2    2     0.0     1.0     0.0\n",
       "1    1.0  1998.7    2    2     0.0     1.0     0.0\n",
       "2    1.0  1641.5    4    1     0.0     1.0     0.0\n",
       "3    1.0   746.9    2    2     0.0     1.0     0.0\n",
       "4    1.0  1210.7    2    1     1.0     0.0     0.0\n",
       "5    1.0  2325.7    2    1     0.0     1.0     0.0\n",
       "6    1.0   286.7    4    2     0.0     0.0     0.0\n",
       "7    1.0  1285.5    4    1     0.0     0.0     1.0\n",
       "8    1.0  2133.0    3    1     0.0     0.0     1.0\n",
       "9    1.0  1066.6    3    1     0.0     0.0     1.0"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 在new_observation里添加一个常量（为了引入截距）\n",
    "new_observation = sm.add_constant(new_observation)\n",
    "new_observation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "72325de8-3d6a-42af-8912-083ab7a04092",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    403709.343688\n",
       "1    715875.928746\n",
       "2    614231.460486\n",
       "3    340676.570920\n",
       "4    463414.678539\n",
       "5    802574.329486\n",
       "6    210259.558968\n",
       "7    513372.336330\n",
       "8    759026.240430\n",
       "9    439396.431206\n",
       "dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 利用前面的线性回归模型，把new_observation作为自变量进行预测\n",
    "predicted_value = result.predict(new_observation)\n",
    "predicted_value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "642ec64d-65fc-40d2-b8f7-957c69f07d03",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
